<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function(){
	$("#tabel1").jqGrid({
	 	url	:'../student/list',
	 	editurl:'../student/edit?tbclassid='+${tbclassid}, 
		caption	: '学生列表',
		postData:{tbclassid:${tbclassid}},
		altRows : true,
		autowidth: true,
		width : 1000,
		height : 'auto',
		datatype : 'json',
		mtype : 'post',
		rowNum : 10,
		rowList : [3,5,10,25,50],
		prmNames : { search : 'search'},
		sortname : 'id',
		viewrecords : true,
		pager : '#div1',
		jsonReader : {
			repeatitems : false,
			id : 'id'
		},
		colModel : [
			{name:'id',label:'序号',index:'id',align:'center',width:50,sorttype:'int'},
			{name:'name',label:'姓名',index:'name',align:'center',width:100,sorttype:'text',editable:true},
			{name:'stuNum',label:'学号',index:'stuNum',align:'center',width:100,sorttype:'text',editable:true},
			{name:'sex',label:'性别',index:'sex',align:'center',width:100,sorttype:'text',editable:true},
			{name:'userName',label:'用户名',index:'userName',align:'center',width:100,sorttype:'text',editable:true},
			/* {name:'tbClass.className',label:'班级',index:'tbClass.className',align:'center',width:100,sorttype:'text'} */
		] 
	});

	
	$("#tabel1").jqGrid('navGrid', '#div1', {
			edit : true,
			add : true,
			del : true,
			//隐藏搜索框
			search:false
		},{
			//改
			top:200,
			left:600
		},{
			//增
			top:200,
			left:600
		},{
			//删
			top:200,
			left:600
		},{
			//查
			top:200,
			left:600,
			sopt: ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'bw', 'bn', 'in', 'ni', 'ew', 'en', 'cn', 'nc'],
			multipleSearch:true
		});
	});
</script>
	<table id="tabel1"></table>
	<div id="div1"></div>